﻿using UnityEngine;
using System.Collections;

public class boton : MonoBehaviour {


	bool staying;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {

		if(staying)
		{
			if(Input.GetButtonDown("Submit"))
			{
				Debug.Log("Apreto Boton");
			}
		}
	
	}


	void OnTriggerStay(Collider obj)
	{
		if(obj.CompareTag("Player1"))
		{
			staying = true;
		}
	}

	void OnTriggerExit(Collider obj)
	{
		if(obj.CompareTag("Player1"))
		{
			staying = false;
		}
	}
}
